Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from ctypes import *
- import random
- if __name__ == '__main__':
- bfs = str(random.randint(100000000000000000000000000, 1000000000000000000000000000000000))
- print(bfs)
- length = len(bfs)
- digits_count = {}
- for digit in range(10):
- digits_count[digit] = bfs.count(str(digit))
- del bfs
- buf = c_buffer(length)
- buf_pointer = 0
- for digit in range(10):
- for i in range(digits_count[digit]):
- buf[buf_pointer + i] = str(digit).encode('UTF-8')
- buf_pointer += digits_count[digit]
- print(string_at(addressof(buf)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement