mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-23 16:26:15 -04:00
refactor: improved shuffle function (now using Durstenfeld shuffle)
This commit is contained in:
parent
436d960603
commit
1ebfe83d20
4 changed files with 23 additions and 8 deletions
|
@ -43,13 +43,13 @@ path: '/bip39-generator'
|
|||
|
||||
<script lang="ts">
|
||||
import * as bip39 from 'bip39'
|
||||
import {shuffle} from '@/utils/string'
|
||||
import {Component, Ref} from 'nuxt-property-decorator'
|
||||
import {CopyableMixin} from '@/mixins/copyable.mixin'
|
||||
import Tool from '@/components/Tool.vue'
|
||||
import type {VForm} from '~/types/VForm'
|
||||
import {shuffleString} from '~/utils/random'
|
||||
|
||||
const getRandomBuffer = () => Buffer.from(shuffle('0123456789abcdef'.repeat(16)).substring(0, 32), 'hex')
|
||||
const getRandomBuffer = () => Buffer.from(shuffleString('0123456789abcdef'.repeat(16)).substring(0, 32), 'hex')
|
||||
|
||||
@Component({
|
||||
mixins: [CopyableMixin]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue