how to hide api key in javascript code example
Example 1: Javascript check for hash in URL
if (location.href.indexOf("#") != -1) {
}
Example 2: js delete object in map
my_map.delete(id)
Example 3: javascript uniqie id
function uuid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
var userID=uuid();
Example 4: javascript clone object
var sheep={"height":20,"name":"Melvin"};
var clonedSheep=JSON.parse(JSON.stringify(sheep));
Example 5: C# how to get public key for InternalsVisibleTo
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("friend_signed_B, PublicKey=" +
"0024000004800000940000000602000000240000525341310004000001000100e3ae" +
"dce99b7e10823920206f8e46cd5558b4ec7345bd1a5b201ffe71660625dcb8f9a086" +
"87d881c8f65a0dcf042f81475d2e88f3e3e273c8311ee40f952db306c02fbfc5d8bc" +
"6ee1e924e6ec8fe8c01932e0648a0d3e5695134af3bb7fab370d3012d083fa6b8317" +
"9dd3d031053f72fc1f7da8459140b0af5afc4d2804deccb6")]
internal class Class1
{
...
}