Hello;
If I need to use frappe.generate_hash in javascript, then what is the equivalent?
@Mohammed_Redha, appreciate your kindly help as I got this from below link that:
Regards
Bilal
Hello;
If I need to use frappe.generate_hash in javascript, then what is the equivalent?
@Mohammed_Redha, appreciate your kindly help as I got this from below link that:
Regards
Bilal
@bghayad you have to define a new javascript function in your custom app :
String.prototype.hash = function() {
var self = this, range = Array(this.length);
for(var i = 0; i < this.length; i++) {
range[i] = i;
}
return Array.prototype.map.call(range, function(i) {
return self.charCodeAt(i).toString(16);
}).join('');
}
How to use it:
"Lorem Ipsum".hash()
"4c6f72656d20497073756d"