本文整理匯總了TypeScript中@mizdra/poke-lcg/uint32.toHexString函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript toHexString函數的具體用法?TypeScript toHexString怎麽用?TypeScript toHexString使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了toHexString函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: toHexString
const seeds = [...g4].map<string>(seed => toHexString(seed, 8));
示例2: generator
import {generator, GEN3_ARG, GEN3_INVERSE_ARG, toHexString} from '@mizdra/poke-lcg/uint32';
import discontinuousGenerator from './discontinuousGenerator';
import initialSeedGenerator from './initialSeedGenerator';
const g1 = generator(GEN3_ARG, 0x00000000);
console.log(toHexString(g1.next().value, 8)); // '00006073'
console.log(toHexString(g1.next().value, 8)); // 'e97e7b6a'
console.log(toHexString(g1.next().value, 8)); // '52713895'
const g2 = generator(GEN3_ARG, 0x00000000, 3);
console.log([...g2].map<string>(seed => toHexString(seed, 8)));
// ['00006073', 'e97e7b6a', '52713895']
const g3 = generator(GEN3_INVERSE_ARG, 0x52713895, 3);
console.log([...g3].map<string>(seed => toHexString(seed, 8)));
// ['e97e7b6a', '00006073', '00000000']
// 1つ飛ばしのseedリストを出力
const g4 = discontinuousGenerator(GEN3_ARG, 0x00000000, 1, 5);
const seeds = [...g4].map<string>(seed => toHexString(seed, 8));
console.log(seeds); // [ '00006073', '52713895', '71bdad79', '503a7537', '-3ccae25' ]
// 初期seedリストを出力
const g5 = initialSeedGenerator(GEN3_INVERSE_ARG, 0xe97e7b6a, 3);
console.log([...g5].map<string>(seed => toHexString(seed, 8)));
// [ '00006073', '00000000', '0000e630']