summaryrefslogtreecommitdiff
path: root/lib/SHA256.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/SHA256.js')
-rw-r--r--lib/SHA256.js28
1 files changed, 1 insertions, 27 deletions
diff --git a/lib/SHA256.js b/lib/SHA256.js
index f79b07d..f47077b 100644
--- a/lib/SHA256.js
+++ b/lib/SHA256.js
@@ -85,32 +85,6 @@ function SHA256(s){
return bin;
}
- function Utf8Encode(string) {
- string = string.replace(/\r\n/g,"\n");
- var utftext = "";
-
- for (var n = 0; n < string.length; n++) {
-
- var c = string.charCodeAt(n);
-
- if (c < 128) {
- utftext += String.fromCharCode(c);
- }
- else if((c > 127) && (c < 2048)) {
- utftext += String.fromCharCode((c >> 6) | 192);
- utftext += String.fromCharCode((c & 63) | 128);
- }
- else {
- utftext += String.fromCharCode((c >> 12) | 224);
- utftext += String.fromCharCode(((c >> 6) & 63) | 128);
- utftext += String.fromCharCode((c & 63) | 128);
- }
-
- }
-
- return utftext;
- }
-
function binb2hex (binarray) {
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
var str = "";
@@ -120,7 +94,7 @@ function SHA256(s){
}
return str;
}
-
+
return binb2hex(core_sha256(str2binb(s), s.length * chrsz));
}