def b16decode(s, casefold=False):
    if casefold:
        s = s.upper()

    # Replace regex code
    #if re.search('[^0-9A-F]', s):
    #    raise TypeError('Non-base16 digit found')
    # Replace with:
    from __javascript__ import RegExp
    r = RegExp('[^0-9A-F]')
    if r.test(s):
        raise TypeError('Non-base16 digit found')

    return binascii.unhexlify(s)



# Legacy interface.  This code could be cleaned up since I don't believe
# binascii has any line length limitations.  It just doesn't seem worth it
# though.
This is a dummy method that should never be called.
dataset/ETHPy150Open anandology/pyjamas/pyjs/src/pyjs/lib/base64.py/b16decode--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/tools/devappserver2/server.py/_ScriptHandler.handle