into bits for conversions

Convert value to a binary primitive.

Signature

> into bits {flags} ...rest

Parameters

  • ...rest: for a data structure input, convert data at the given cell paths

Input/output types:

inputoutput
binarystring
boolstring
durationstring
filesizestring
intstring
recordrecord
stringstring
tabletable

Examples

convert a binary value into a string, padded to 8 places with 0s

> 01b | into bits
00000001

convert an int into a string, padded to 8 places with 0s

> 1 | into bits
00000001

convert a filesize value into a string, padded to 8 places with 0s

> 1b | into bits
00000001

convert a duration value into a string, padded to 8 places with 0s

> 1ns | into bits
00000001

convert a boolean value into a string, padded to 8 places with 0s

> true | into bits
00000001

convert a string into a raw binary string, padded with 0s to 8 places

> 'nushell.sh' | into bits
01101110 01110101 01110011 01101000 01100101 01101100 01101100 00101110 01110011 01101000