MCPcopy Index your code
hub / github.com/angular-app/angular-app / md51

Function md51

client/src/common/directives/gravatar.js:154–177  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

152 }
153
154 function md51(s) {
155 txt = '';
156 var n = s.length,
157 state = [1732584193, -271733879, -1732584194, 271733878],
158 i;
159 for (i = 64; i <= s.length; i += 64) {
160 md5cycle(state, md5blk(s.substring(i - 64, i)));
161 }
162 s = s.substring(i - 64);
163 var tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
164 for (i = 0; i < s.length; i++) {
165 tail[i >> 2] |= s.charCodeAt(i) << ((i % 4) << 3);
166 }
167 tail[i >> 2] |= 0x80 << ((i % 4) << 3);
168 if (i > 55) {
169 md5cycle(state, tail);
170 for (i = 0; i < 16; i++) {
171 tail[i] = 0;
172 }
173 }
174 tail[14] = n * 8;
175 md5cycle(state, tail);
176 return state;
177 }
178
179 /* there needs to be support for Unicode here,
180 * unless we pretend that we can redefine the MD-5

Callers 1

md5Function · 0.85

Calls 2

md5cycleFunction · 0.85
md5blkFunction · 0.85

Tested by

no test coverage detected