Quick function to deep merge using Object.assign()
. Thoughts?
/**
* Simple is object check.
* @param item
* @returns {boolean}
*/
//https://github.com/node-modules/emoji | |
//http://apps.timwhitlock.info/emoji/tables/unicode | |
var unified_emoji_ranges = [ | |
'\ud83c[\udf00-\udfff]', // U+1F300 to U+1F3FF | |
'\ud83d[\udc00-\ude4f]', // U+1F400 to U+1F64F | |
'\ud83d[\ude80-\udeff]' // U+1F680 to U+1F6FF | |
]; |
<?php | |
/** | |
* PseudoCrypt by KevBurns (http://blog.kevburnsjr.com/php-unique-hash) | |
* Reference/source: http://stackoverflow.com/a/1464155/933782 | |
* | |
* I want a short alphanumeric hash that’s unique and who’s sequence is difficult to deduce. | |
* I could run it out to md5 and trim the first n chars but that’s not going to be very unique. | |
* Storing a truncated checksum in a unique field means that the frequency of collisions will increase | |
* geometrically as the number of unique keys for a base 62 encoded integer approaches 62^n. | |
* I’d rather do it right than code myself a timebomb. So I came up with this. |