Thursday, 10 August 2017

JsonToBytes

Some funny stuff ;)

convert your json into bytes.. !!

const bytes = function(s) {
return ~-encodeURI(s).split(/%..|./).length
}
const jsonSize = function(s){
return bytes(JSON.stringify(s))
}
console.log(jsonSize({foo: 'bar'})) //=> 13
view raw test.js hosted with ❤ by GitHub

No comments:

Salesforce CRM vs. Zoho: A Comparative Analysis

Introduction: Selecting the right customer relationship management (CRM) software is crucial for businesses seeking to streamline their sal...