Fix bit math error, explicitly seed random number generator
This commit is contained in:
parent
202095edad
commit
d1736dcb06
@ -69,7 +69,7 @@ local function guid_generate()
|
||||
|
||||
-- Set the two most significant bits (bits 6 and 7) of the
|
||||
-- clock_seq_hi_and_reserved to zero and one, respectively.
|
||||
bytes[9] = bit.band(bit.bor(bytes[9], 0x80), 0x8f)
|
||||
bytes[9] = bit.band(bit.bor(bytes[9], 0x80), 0xbf)
|
||||
|
||||
-- Set the four most significant bits (bits 12 through 15) of the
|
||||
-- time_hi_and_version field to the 4-bit version number.
|
||||
|
@ -18,6 +18,8 @@ if not vim.g.guid then
|
||||
guid.guid_object()
|
||||
end
|
||||
|
||||
math.randomseed(os.time())
|
||||
|
||||
vim.api.nvim_create_user_command('GuidFormat', format, {nargs = '?'})
|
||||
vim.api.nvim_create_user_command('GuidInsert', insert, {nargs = '?'})
|
||||
vim.api.nvim_create_user_command('GuidObject', object, {})
|
||||
|
Loading…
Reference in New Issue
Block a user