Vyxal, 1416 bytes
Lp8β1LbLEτḢꜝ‹İb8∆Zf0LbLẇvBꜝ‹İ∑
Avoiding binary completely. Thanks to @KevinCruijssen for spotting a bug.Try it Online!
Lp # Prependb length of encoder key to digits (for 0-padding)
8β # Convert fromeach basefrom 256binary
8∆Z τ # ConvertPad each to base:length 8
f # Encoder# key...
Flatten
E # 2 to the power of
ẇ LbL # Split into #chunks Bitof length of... 1 0LbL # Encoder key
Length of Ḣthe encoder string, in #binary
Remove the padding character.
vBꜝ‹ # Convert ꜝ‹each from #binary, Removeremove 0s and decrement
İ İ∑ # Index those into inputthe stringencoder and sum
Vyxal, 14 bytes
Lp8β1LbLEτḢꜝ‹İ
Avoiding binary completely. Thanks to @KevinCruijssen for spotting a bug.
Lp # Prepend length of encoder key to digits (for 0-padding)
8β # Convert from base 256
τ # Convert to base:
# Encoder key...
E # 2 to the power of
LbL # Bit length of... 1 # Encoder key
Ḣ # Remove the padding character.
ꜝ‹ # Remove 0s and decrement
İ # Index into input string
Vyxal, 16 bytes
b8∆Zf0LbLẇvBꜝ‹İ∑
b # Convert each from binary
8∆Z # Pad each to length 8
f # Flatten
ẇ # Split into chunks of length... 0LbL # Length of the encoder string, in binary
vBꜝ‹ # Convert each from binary, remove 0s and decrement
İ∑ # Index those into the encoder and sum
Vyxal, 1314 bytes
Lp8β15bLE↲ǔτḢLp8β1LbLEτḢꜝ‹İ
Avoiding binary completely. Thanks to @KevinCruijssen for spotting a bug.
Lp # Prepend length of encoder key to digits (for 0-padding)
8β # Convert from base 256
τ τ # Convert to string base:
1 # Encoder key...
E ↲ # Padded# right2 to length...
the power of
ELbL # 2 to# theBit powerlength of...
1 5bL # Bit length of# encoderEncoder key
ǔḢ # ShiftRemove the wholepadding thingcharacter.
right for indexing ꜝ‹ # Remove 0s and decrement
Ḣ İ # RemoveIndex theinto paddinginput character.string
Vyxal, 13 bytes
Lp8β15bLE↲ǔτḢ
Avoiding binary completely
Lp # Prepend length of encoder key to digits (for 0-padding)
8β # Convert from base 256
τ # Convert to string base:
1 # Encoder key...
↲ # Padded right to length...
E # 2 to the power of
5bL # Bit length of encoder key
ǔ # Shift the whole thing right for indexing
Ḣ # Remove the padding character.
Vyxal, 14 bytes
Lp8β1LbLEτḢꜝ‹İ
Avoiding binary completely. Thanks to @KevinCruijssen for spotting a bug.
Lp # Prepend length of encoder key to digits (for 0-padding)
8β # Convert from base 256
τ # Convert to base:
# Encoder key...
E # 2 to the power of
LbL # Bit length of...
1 # Encoder key
Ḣ # Remove the padding character.
ꜝ‹ # Remove 0s and decrement
İ # Index into input string
Vyxal, 1613 bytes
b8∆Zf0LbLẇvBꜝ‹İ∑Lp8β15bLE↲ǔτḢ
Avoiding binary completely
b Lp # Prepend length #of Convertencoder eachkey fromto binary
digits 8∆Z(for 0-padding)
8β # Pad eachConvert tofrom lengthbase 8256
f τ # Convert to #string Flattenbase:
1 ẇ # Encoder key...
# Split into chunks of ↲ # Padded right to length...
0LbL E # Length2 ofto the encoderpower string,of
in binary
5bL # vBꜝ‹Bit length of #encoder Convertkey
each from binary, remove 0s and decrement
ǔ # Shift the whole thing right for indexing
İ∑ # Index those into the encoder and sum Ḣ # Remove the padding character.
Vyxal, 16 bytes
b8∆Zf0LbLẇvBꜝ‹İ∑
b # Convert each from binary
8∆Z # Pad each to length 8
f # Flatten
ẇ # Split into chunks of length...
0LbL # Length of the encoder string, in binary
vBꜝ‹ # Convert each from binary, remove 0s and decrement
İ∑ # Index those into the encoder and sum
Vyxal, 13 bytes
Lp8β15bLE↲ǔτḢ
Avoiding binary completely
Lp # Prepend length of encoder key to digits (for 0-padding)
8β # Convert from base 256
τ # Convert to string base:
1 # Encoder key...
↲ # Padded right to length...
E # 2 to the power of
5bL # Bit length of encoder key
ǔ # Shift the whole thing right for indexing
Ḣ # Remove the padding character.
Loading
Loading
Loading