Comparing version 0.8.5 to 0.8.6
16
hash.js
@@ -44,2 +44,3 @@ var fnv = require('fnv-plus') | ||
hash.sequenceHash = sequenceHash | ||
hash.sequenceNext = splitmix32 | ||
@@ -53,2 +54,15 @@ hash.unsafeFastHash = unsafeFastHash | ||
// Adapted from https:github.com/bryc/code/blob/master/jshash/PRNGs.md#splitmix32 | ||
function splitmix32(a) { | ||
a |= 0 | ||
a = (a + 0x9e3779b9) | 0 | ||
var t = a ^ (a >>> 16) | ||
// eslint-disable-next-line es5/no-es6-static-methods | ||
t = Math.imul(t, 0x21f0aaad) | ||
t = t ^ (t >>> 15) | ||
// eslint-disable-next-line es5/no-es6-static-methods | ||
t = Math.imul(t, 0x735a2d97) | ||
return (t = t ^ (t >>> 15)) >>> 0 | ||
} | ||
// eslint-disable-next-line es5/no-generators | ||
@@ -60,3 +74,3 @@ function* sequenceHash(initial) { | ||
while (true) { | ||
current = unsafeFastHash(current.toString()) | ||
current = splitmix32(current) | ||
yield current | ||
@@ -63,0 +77,0 @@ } |
@@ -30,2 +30,3 @@ export type JSONPrimitive = null | number | string | boolean | ||
sequenceHash(initial: number): Generator<number> | ||
sequenceNext(current: number): number | ||
combine(a: number, b: number): number | ||
@@ -32,0 +33,0 @@ setKey(key: string | HashKey): void |
{ | ||
"name": "fictional", | ||
"description": "Generate fake data deterministically from a given input", | ||
"version": "0.8.5", | ||
"version": "0.8.6", | ||
"type": "commonjs", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
@@ -9,9 +9,9 @@ # `fictional` | ||
word('id-1') | ||
// => 'Raệkoshi' | ||
// => 'Hayuɍa' | ||
word('id-2') | ||
// => 'Tąme' | ||
// => 'M̃ona' | ||
word('id-1') | ||
// => 'Raệkoshi' | ||
// => 'Hayuɍa' | ||
``` | ||
@@ -27,9 +27,9 @@ | ||
user('id-1') | ||
// => { name: 'Nɨ Nohakemá Yuꝁaina' } | ||
// => { name: 'Mẩ Minocḛayo Mokeƫa' } | ||
user('id-2') | ||
// => { name: 'Kaᶄevamu Hacḣimo' } | ||
// => { name: 'Ǩamokeha Kèmoke' } | ||
user('id-1') | ||
// => { name: 'Nɨ Nohakemá Yuꝁaina' } | ||
// => { name: 'Mẩ Minocḛayo Mokeƫa' } | ||
``` | ||
@@ -94,3 +94,3 @@ | ||
user('id-1') | ||
// => { id: 4641209466322491, name: { first: 'Raeniƴo', last: 'Nḁchi' } } | ||
// => { id: 4641209466322491, name: { first: 'Rachḯno', last: 'Vẚni' } } | ||
``` | ||
@@ -127,3 +127,3 @@ | ||
word('id-1') | ||
// => 'Raệkoshi' | ||
// => 'Hayuɍa' | ||
``` | ||
@@ -146,3 +146,3 @@ | ||
}) | ||
// => 'Kī̀nchihani' | ||
// => 'Ḵaceanochi' | ||
@@ -153,3 +153,3 @@ word({ | ||
}) | ||
// => 'Kī̀nchihani' | ||
// => 'Ḵaceanochi' | ||
``` | ||
@@ -170,6 +170,6 @@ | ||
streetAddress('id-1') | ||
// => '82 Y̊oke Drive' | ||
// => '82 Tayunaṩhi Drive' | ||
streetAddress('id-2') | ||
// => '132 Ẏukaikeki Street' | ||
// => '132 Shimặkokai Street' | ||
``` | ||
@@ -200,3 +200,3 @@ | ||
tuple('id-1', [word, word]) | ||
// => [ 'Ṱayu', 'Y̊oke' ] | ||
// => [ 'Kimǒ', 'Tayunaṩhi' ] | ||
@@ -282,6 +282,6 @@ // this is roughly the same as doing | ||
companyName('id-1') | ||
// => 'Ṱayu Systems' | ||
// => 'Kimǒ Incorporated' | ||
companyName('id-2') | ||
// => 'Moʋa Systems' | ||
// => 'Chiā Incorporated' | ||
``` | ||
@@ -484,3 +484,3 @@ | ||
word('id-23') | ||
// => 'Muvẩ' | ||
// => 'Vȉyo' | ||
``` | ||
@@ -507,3 +507,3 @@ | ||
}) | ||
// => 'Ța' | ||
// => 'Mō' | ||
``` | ||
@@ -518,3 +518,3 @@ | ||
words('id-23') | ||
// => 'Kiṇmihy tǟhyme meȟy' | ||
// => 'Ꝁihyna kinokiṋha ṁu' | ||
``` | ||
@@ -547,3 +547,3 @@ | ||
}) | ||
// => 'Nṓvishikai Șoma Ke Hyvicea Mï Mȅki' | ||
// => 'Kiyuyova Kona Mạ Kiyo̩ma Kin So' | ||
``` | ||
@@ -558,3 +558,3 @@ | ||
sentence('id-23') | ||
// => 'Ha vakina kachi hǎ nirae sohyme, kamukin vamusomi kinỳomuyo some nokai.' | ||
// => 'Yutaṃo kahy kiraeǩaino nonavi kį̃ntami hy, cẻa ᶄi naki no shiraeki mụ nònaniyu.' | ||
``` | ||
@@ -585,3 +585,3 @@ | ||
}) | ||
// => 'Ranọmu ceameyu, m̃ashia manohasộ.' | ||
// => 'Ȼhiyoa vamoḱerae, kǐn makớ.' | ||
``` | ||
@@ -596,3 +596,3 @@ | ||
paragraph('id-23') | ||
// => 'Maketaki ceaki mø kiashi kesokaimu raemaḉhi ta, rayuta ha namimeki hǟkiyu raeshichi raemiraechi. Vaketayo vį̃ nimu hykaika hyki kihahykaī̀ vakeyoke hysomi. Sonaȟyha chiko kāso socea kime cḣihyma. Kinva kinmemami mïko no shimemoa. Ṃu shicħi chi nöhakoyu ṁichi nimome nichikaį̃chi yuahyki, racea hasomu ʋi mehakino mi mắceamu soka shihykami. Ḳo makemira nỉceamo ni kechiyu kinmiraechi ka vamo. Cea chimo hakesohý yo yohy kaishimo yovamu kinmenino.' | ||
// => 'Kinmonako cềamiva rấe sochiyu kai kaishiỹo chi va, mẫyu raviyǿmi konâki ȳu hykavika ra vihasohy yo. Mo kayơra sochi nashisőma chisȱ cea ᶄe chiceǎvi, kǎi some shi ko kaichivako. Shi koᶄahy ki yoṿa chiha. Niraeayu kaiyukovi kekiyome kokaṁo rakinraeko raenikeni m̃okairaechi. Vayọ ka moha ko yuhỳmi. Hyha kokayớ shi řa kaniyuki. Noraekai korae mu yoviƈeachi naceaki mimani norashi, kinhy kisoňike nakikechi kimomu ḿo ceakiţa tachi hyka.' | ||
``` | ||
@@ -623,3 +623,3 @@ | ||
}) | ||
// => 'Kḛkin kinkeviṁu rahysḣi kî ᶄesora. Ŷomu ceasokịrae noỹu misoƙishi chį̃, ṛasomeva raeṿi mḛ rahỹvame shikaiḱeko kinḱeyu. Kiyomi nö hamōchira kinceasoha raćhima minokeshi. Mume hasōkin niʋakinke kehakiȧ ṁo kiäyuni čhiahy ceaḳe, tãhymimu mukiņ hǻ vacħi yǘmonahy vimümo.' | ||
// => 'Mimǖcea yṑkaishi muceằme yuhahỷ kiÿo. Kaimuńake koviᶄeni hacħi mukoma ńa yų́. Moshịnova yokiçhi ņiyohy noshȉmacea ṽi, kaiḫayo ǩe hÿami mɵ raekoǹichi. Ketænovi ǩi vakoshi chi haʋi.' | ||
``` | ||
@@ -637,3 +637,3 @@ | ||
join('id-23', ' ', [word, oneOf(['Street', 'Drive'])]) | ||
// => 'Naceakõmu Street' | ||
// => 'Meràemukin Drive' | ||
``` | ||
@@ -646,3 +646,3 @@ | ||
join('id-2', ' ', [word, 'Drive']) | ||
// => 'Moʋa Drive' | ||
// => 'Chiā Drive' | ||
``` | ||
@@ -655,3 +655,3 @@ | ||
join('id-3', ([a, b, c]) => `${a}-${b} ${c}`, [word, word, word]) | ||
// => 'Namī̀nocea-Viḱaikemu Rẫhyshi' | ||
// => 'Yoceahyʋa-Ceắmumiha Ǩinta' | ||
``` | ||
@@ -664,3 +664,3 @@ | ||
join('id-2', '', [char.letter, times(3, char.alphanumeric)]) | ||
// => 'rKuL' | ||
// => 'redU' | ||
``` | ||
@@ -683,3 +683,3 @@ | ||
oneOf('id-2', [int, word, char]) | ||
// => 'Mốta' | ||
// => 'Ceảni' | ||
``` | ||
@@ -706,3 +706,3 @@ | ||
someOf('id-2', 2, ['red', 'green', 'blue']) | ||
// => [ 'blue', 'red' ] | ||
// => [ 'blue', 'green' ] | ||
``` | ||
@@ -726,3 +726,3 @@ | ||
times('id-23', [4, 5], word) | ||
// => [ 'Kaiḣaso', 'Niávi', 'Nȫta', 'Muḿemu' ] | ||
// => [ 'Miką', 'Kảkiko', 'Muhÿko', 'Nặso' ] | ||
``` | ||
@@ -736,3 +736,3 @@ | ||
times('id-2', 2, word) | ||
// => [ 'Chį̃meta', 'Shiȟavi' ] | ||
// => [ 'Kerămi', 'Ḿachi' ] | ||
``` | ||
@@ -748,3 +748,3 @@ | ||
tuple('id-23', [char, char]) | ||
// => [ '7', '3' ] | ||
// => [ '7', 'A' ] | ||
``` | ||
@@ -771,3 +771,3 @@ | ||
}) | ||
// => { firstName: 'Yomuńiyu', lastName: 'Ÿumemo' } | ||
// => { firstName: 'Vikeýuvi', lastName: 'Kinceamṓ' } | ||
``` | ||
@@ -783,3 +783,3 @@ | ||
}) | ||
// => { name: 'Soraēhyrae Muṃeni', active: true } | ||
// => { name: 'Hahysoʋa Ceahỵme', active: true } | ||
``` | ||
@@ -813,3 +813,3 @@ | ||
]) | ||
// => 'Vikoķaita' | ||
// => 'Kakiḿekai' | ||
``` | ||
@@ -816,0 +816,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
718121
41
2506