download
raw
558 Bytes
'use strict';
// https://mathiasbynens.be/notes/javascript-encoding
// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode
module.exports = function ucs2length(str) {
var length = 0
, len = str.length
, pos = 0
, value;
while (pos < len) {
length++;
value = str.charCodeAt(pos++);
if (value >= 0xD800 && value <= 0xDBFF && pos < len) {
// high surrogate, and there is a next character
value = str.charCodeAt(pos);
if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate
}
}
return length;
};

Xet Storage Details

Size:
558 Bytes
·
Xet hash:
1784220b1a99bd17dbea9ace9bd23bf1aba3ad9af3bc26a97cf9e2e173d60778

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.