MCPcopy Index your code
hub / github.com/hoothin/UserScripts / base32To16

Function base32To16

Easy offline/Easy offline.user.js:1150–1168  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

1148 }
1149
1150 function base32To16(str){
1151 if(str.length % 8 !== 0 || /[0189]/.test(str)){
1152 return str;
1153 }
1154 str = str.toUpperCase();
1155 var bin = "", returnStr = "", i;
1156 for(i = 0;i < str.length;i++){
1157 var charCode=str.charCodeAt(i);
1158 if(charCode<65)charCode-=24;
1159 else charCode-=65;
1160 charCode='0000'+charCode.toString(2);
1161 charCode=charCode.substr(charCode.length-5);
1162 bin+=charCode;
1163 }
1164 for(i = 0;i < bin.length;i+=4){
1165 returnStr += parseInt(bin.substring(i,i+4),2).toString(16);
1166 }
1167 return returnStr;
1168 }
1169
1170 function urlArgs(query){
1171 let args = {};

Callers 1

getRightUrlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected