Ah, but try that with echo -n so it doesn't add a line feed.

I discovered the problem by pasting it into a website somewhere to check the sum, and investigated further using echo and shasum.

-John

On Jan 15, 2013, at 12:45 PM, Eric <notifications@github.com> wrote:

> In en/02-concepts.md:
> 
> > @@ -180,7 +180,7 @@ Riak follows the *consistent hashing* technique, that conceptually maps objects
> >  
> >  Riak partitions are not mapped alphabetically (as we used in the examples above), but instead, a partition marks a range of key hashes (SHA-1 function applied to a key). The maximum hash value is 2^160, and divided into some number of partitions---64 partitions by default (the Riak config setting is `ring_creation_size`).
> >  
> > -Let's walk through what all that means. If you have the key `favorite`, applying the SHA-1 algorithm would return `dc2b 258d 7221 3f8d 05d1 5973 a66d c156 847b 83f4` in hexadecimal. With 64 partitions, each partition has 1/64 of the 2^160 possible values, making the first partition range from 0 to 2^154-1, the second range is 2^154 to 2*2^154-1, and so on, up to the last partition 63*2^154-1 to 2^160-1.
> > +Let's walk through what all that means. If you have the key `favorite`, applying the SHA-1 algorithm would return `7501 7a36 ec07 fd4c 377a 0d2a 0114 00ab 193e 61db` in hexadecimal. With 64 partitions, each partition has 1/64 of the 2^160 possible values, making the first partition range from 0 to 2^154-1, the second range is 2^154 to 2\*2^154-1, and so on, up to the last partition 63\*2^154-1 to 2^160-1.
> I'm not sure where you get this value:
> 
> $ echo "favorite" | shasum
> dc2b258d72213f8d05d15973a66dc156847b83f4  -
> That aside, I actually calculated it using the same erlang function that riak uses.
> 
> —
> Reply to this email directly or view it on GitHub.
> 
>