summaryrefslogtreecommitdiff
path: root/include/ruby/atomic.h
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2021-10-25 17:02:42 +0200
committergit <svn-admin@ruby-lang.org>2021-10-26 01:51:05 +0900
commit557fa389155810f38f111c00a649c313a639dbb5 (patch)
treee3bddf2cdef57ae6721786a810500691ff8bb5fc /include/ruby/atomic.h
parent244c98e635a01cc7cfde9e24ed4b44413e6c3e75 (diff)
[rubygems/rubygems] Fix Bundler::Digest#sha1 on big-endian systems
As noticed by @nobu https://github.com/rubygems/rubygems/pull/4989#discussion_r735674633 From wikipedia: https://en.wikipedia.org/wiki/SHA-1#SHA-1_pseudocode > append ml, the original message length in bits, as a 64-bit big-endian integer. `Q` is native endian, so little-endian on most modern hardware. The original code from RubyDigest reverses the bytes: https://github.com/Solistra/ruby-digest/blob/d15f906caf09171f897efc74645c9e31373d7fd1/lib/ruby_digest.rb#L521 But that makes the code non-portable, the correct way is to directly ask for a big-endian representation. https://github.com/rubygems/rubygems/commit/ba2be01ea4
Diffstat (limited to 'include/ruby/atomic.h')
0 files changed, 0 insertions, 0 deletions