class Wechat::Callback::RandomByteArray

Random Byte Array 用于生成指定长度的随机数组。

Constants

LENGTH

Public Class Methods

create(length = LENGTH) click to toggle source

常见一个指定长度的随机字节数组。

# File lib/wechat/callback/random_byte_array.rb, line 12
def self.create(length = LENGTH)

  assert_present! :length, length

  [*0..255].sample length

end