pharo: Use something that is now in OsmoCore
Do not relay on the HLR to be loaded
This commit is contained in:
parent
aa7002b2e1
commit
e6f5e3afde
|
@ -2,17 +2,17 @@
|
|||
SIPURandom class extend [
|
||||
nextByte [
|
||||
<category: 'random'>
|
||||
^(RAND rand: 1) first.
|
||||
^(OsmoSecureRandom rand: 1) first.
|
||||
]
|
||||
|
||||
nextInt [
|
||||
<category: 'random'>
|
||||
^(RAND rand: 4) asInteger
|
||||
^(OsmoSecureRandom rand: 4) asInteger
|
||||
]
|
||||
|
||||
nextFourBytes [
|
||||
<category: 'random'>
|
||||
^RAND rand: 4
|
||||
^OsmoSecureRandom rand: 4
|
||||
]
|
||||
]
|
||||
|
||||
|
@ -20,14 +20,14 @@ SIPUserAgentBase class extend [
|
|||
generateCSeq [
|
||||
<category: 'helper'>
|
||||
"For pharo just use the random we have"
|
||||
^(RAND rand: 4) asInteger abs
|
||||
^(OsmoSecureRandom rand: 4) asInteger abs
|
||||
]
|
||||
|
||||
generateBranch [
|
||||
| data |
|
||||
data := '<1p>,<2p>' expandMacrosWithArguments:
|
||||
{DateTime now asUTC asSeconds.
|
||||
(RAND rand: 2) asInteger}.
|
||||
(OsmoSecureRandom rand: 2) asInteger}.
|
||||
^ self branchStart, (SIPBase64 encode: data).
|
||||
]
|
||||
]
|
||||
|
|
Reference in New Issue