summaryrefslogtreecommitdiff
path: root/set1/challenge1.py
blob: 97d82d9287b39262a4a94913218e2f2d2b06dea3 (plain)
1
2
3
4
5
6
7
8
9
import base64

s = '49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d'
expected = 'SSdtIGtpbGxpbmcgeW91ciBicmFpbiBsaWtlIGEgcG9pc29ub3VzIG11c2hyb29t'

def hex_str_to_base64(s):
    return base64.b64encode(s.decode('hex'))

assert hex_str_to_base64(s) == expected