Mercurial > hg > piper-cpp
comparison json/base-n/example/basen_example.cpp @ 38:eb004c1b9579
Update base-n code from https://github.com/azawadzki/base-n
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Mon, 22 Aug 2016 17:16:11 +0100 |
parents | 6e8607ebad03 |
children |
comparison
equal
deleted
inserted
replaced
37:f8332b1acfc2 | 38:eb004c1b9579 |
---|---|
68 static size_t group_length() | 68 static size_t group_length() |
69 { | 69 { |
70 return 3; | 70 return 3; |
71 } | 71 } |
72 | 72 |
73 static char encode(int index) | 73 static char encode(unsigned int index) |
74 { | 74 { |
75 const char* const dictionary = "01234567"; | 75 const char* const dictionary = "01234567"; |
76 assert(index < strlen(dictionary)); | 76 assert(index < strlen(dictionary)); |
77 return dictionary[index]; | 77 return dictionary[index]; |
78 } | 78 } |