本文整理汇总了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']