[Solved] perl quick switch from quaternary to decimal

Base 4 requires exactly 2 bits, so it’s easy to handle efficiently. my $uvsize = length(pack(‘J>’, 0)) * 8; my %base4to2 = map { $_ => sprintf(‘%2b’, $_) } 0..3; sub base4to10 { my ($s) = @_; $s =~ s/(.)/$base4to2{$1}/sg; $s = substr((“0” x $uvsize) . $s, -$uvsize); return unpack(‘J>’, pack(‘B*’, $s)); } This allows … Read more

[Solved] ValueError: too many values to unpack (Python 2.7)

Check the output of print len(values) It has more than 5 values (which is the number of variables you are trying to “unpack” it to) which is causing your “too many values to unpack” error: username, passwordHash, startRoom, originUrl, bs64encode = values If you want to ignore the tail end elements of your list, you … Read more