-
Notifications
You must be signed in to change notification settings - Fork 1
/
utils.py
35 lines (33 loc) · 1.09 KB
/
utils.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# file: util.py
# -*- coding: utf-8 -*-
import uuid
import md5
def convert_e2b(number):
n = str(number)
bengali_number = u''
for char in n:
if char == '0':
bengali_number = bengali_number + u'০'
elif char == '1':
bengali_number = bengali_number + u'১'
elif char == '2':
bengali_number = bengali_number + u'২'
elif char == '3':
bengali_number = bengali_number + u'৩'
elif char == '4':
bengali_number = bengali_number + u'৪'
elif char == '5':
bengali_number = bengali_number + u'৫'
elif char == '6':
bengali_number = bengali_number + u'৬'
elif char == '7':
bengali_number = bengali_number + u'৭'
elif char == '8':
bengali_number = bengali_number + u'৮'
elif char == '9':
bengali_number = bengali_number + u'৯'
elif char == '.':
bengali_number = bengali_number + u'.'
return bengali_number
def get_uuid():
return md5.new(str(uuid.uuid1())).hexdigest()