MCPcopy
hub / github.com/mumuy/browser / convertToWordArray

Function convertToWordArray

src/module/utils/getMD5.js:57–78  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

55};
56
57let convertToWordArray = function(string) {
58 let lWordCount;
59 let lMessageLength = string.length;
60 let lNumberOfWordsTempOne = lMessageLength + 8;
61 let lNumberOfWordsTempTwo = (lNumberOfWordsTempOne - (lNumberOfWordsTempOne % 64)) / 64;
62 let lNumberOfWords = (lNumberOfWordsTempTwo + 1) * 16;
63 let lWordArray = Array(lNumberOfWords - 1);
64 let lBytePosition = 0;
65 let lByteCount = 0;
66 while(lByteCount < lMessageLength) {
67 lWordCount = (lByteCount - (lByteCount % 4)) / 4;
68 lBytePosition = (lByteCount % 4) * 8;
69 lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition));
70 lByteCount++;
71 }
72 lWordCount = (lByteCount - (lByteCount % 4)) / 4;
73 lBytePosition = (lByteCount % 4) * 8;
74 lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition);
75 lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
76 lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
77 return lWordArray;
78};
79
80let wordToHex = function(lValue) {
81 let WordToHexValue = "",

Callers 1

getMD5.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…