Hey,

I'm using keys generated by Riak  and have come over some random
failure in my test cases. I have naively assumed that the 160bit hash
would always return a base62 encoded value with the length of 27. On
that point I'm obviously wrong as the shell session below shows.

My question is this by design? If so is there a way to enforce certain
size of a key WITHOUT performing generation outside Riak?

Test of riak key size:

72> P = fun(S) -> put(S, case get(S) of undefined -> 1; X -> X+1 end) end.
#Fun<erl_eval.6.82930912>
73> F = fun(X, A) when A =< 1000000 ->
P(length(riak_core_util:unique_id_62())), X(X, A+1); (_, A) -> A end.
#Fun<erl_eval.12.82930912>
74> F(F, 0).
1000001
75> erlang:process_info(self(), dictionary).
{dictionary,[{27,982324},{26,27210},{25,461},{24,7}]}

Cheers,
Olav

_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to