Add scripts

This commit is contained in:
Alex Kup 2023-08-03 11:24:09 +03:00 committed by GitHub
parent 45b95998ae
commit 8609b6ff17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 213 additions and 0 deletions

View file

@ -0,0 +1,22 @@
function ConvertTo-Bit {
param (
[Int]$int
)
[array]$bits = @()
$test = $true
while ($test -eq $true) {
if (($int/2).GetType() -match [double]) {
$int = ($int-1)/2
[array]$bits += 1
}
elseif (($int/2).GetType() -match [int]) {
$int = $int/2
[array]$bits += 0
}
if ($int -eq 0) {
$test = $false
}
}
$bits = $bits[-1..-999]
([string]($bits)) -replace "\s"
}