SHA1 reversed bytes?

Tony Garnock-Jones tonyg at lshift.net
Mon Mar 7 16:13:23 UTC 2005


Hello list,

Why does

  (SHA1 new hashMessage: 'ede8557d-8e2f-11d9-8a80-000a95e87d06tonyg')
		hex asLowercase
give
  '52fbe248257f325b5ceeba8b2278a9a28442f8d6'
	
when

  $ echo -n 'ede8557d-8e2f-11d9-8a80-000a95e87d06tonyg' | openssl sha1
gives
  d6f84284a2a978228bbaee5c5b327f2548e2fb52

? (Note that they are exactly byte-reversed.) Of course, I could just 
say "... reverse hex asLowercase" instead, but it seems strange that I 
should need to. There must be something obvious I'm overlooking.

Tony
-- 
  [][][] Tony Garnock-Jones  | Mob: +44 (0)7905 974 211
    [][] LShift Ltd          | Tel: +44 (0)20 7729 7060
  []  [] www.lshift.net      | Email: tonyg at lshift.net



More information about the Squeak-dev mailing list