Skip to content

Commit

Permalink
Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sinclairzx81 committed Dec 26, 2024
1 parent 2c10797 commit 5a4b84a
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions example/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,3 @@ import { Parse, StaticParseAsType } from '@sinclair/typebox/syntax'
import { Type, TypeGuard, Kind, Static, TSchema } from '@sinclair/typebox'

const A = Type.String({ format: 'ipv4' })

const S = "!#$%&'*+/=?^_`{|}~-"

function shuffleString(str: string) {
// Convert the string into an array of characters
const arr = str.split('')

// Fisher-Yates (or Knuth) shuffle algorithm
for (let i = arr.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1))

// Swap the elements at index i and j
;[arr[i], arr[j]] = [arr[j], arr[i]]
}

// Join the array back into a string and return it
return arr.join('')
}

console.log(shuffleString(S))

0 comments on commit 5a4b84a

Please sign in to comment.