Skip to content

Commit

Permalink
Update basicTypes.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Captian-obvious authored Nov 23, 2023
1 parent e3554b9 commit d5d9dd4
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion basicTypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ def conditionalSet(condition,val1,val2):
return val2
##endif
##end
def listToString(s,sep,i,j):
str1=""
for ele in s:
str1=str1+ele
if (sep!=None):
str1=str1+sep
##endif
##end
return str1
##end
def lrotate(n,d):
return (n << d)|(n >> (32 - d))
##end
Expand Down Expand Up @@ -38,5 +48,15 @@ def InterleaveArrayWithSize(buffer, count, sizeof):
if (count<0):
return Buffer.new("", False)
##endif
stream = buffer.read(count * sizeof)
stream=buffer.read(count * sizeof)
out=createTable(count)
for i in range(count):
chunk=createTable(sizeof)
for s in range(sizeof):
bitPos=i+(count*s)
chunk[s]=stream[bitPos:bitPos+1]
##end
out[i]=concat(chunk)
##end
return Buffer.new(concat(out),False)
##end

0 comments on commit d5d9dd4

Please sign in to comment.