Module: Protocol::Multipart
- Defined in:
- lib/protocol/multipart.rb,
lib/protocol/multipart/part.rb,
lib/protocol/multipart/mixed.rb,
lib/protocol/multipart/escape.rb,
lib/protocol/multipart/parser.rb,
lib/protocol/multipart/io_part.rb,
lib/protocol/multipart/version.rb,
lib/protocol/multipart/boundary.rb,
lib/protocol/multipart/form_data.rb,
lib/protocol/multipart/string_part.rb
Defined Under Namespace
Modules: Escape Classes: FormData, IOPart, Mixed, Parser, Part, StringPart
Constant Summary collapse
- VERSION =
"0.1.1"
Class Method Summary collapse
-
.secure_boundary(prefix = nil, length = 24) ⇒ Object
Generate a secure boundary string for multipart messages.
Class Method Details
.secure_boundary(prefix = nil, length = 24) ⇒ Object
Generate a secure boundary string for multipart messages. Approximately 192 bits of entropy by default, which is sufficient for most applications.
12 13 14 15 16 17 18 |
# File 'lib/protocol/multipart/boundary.rb', line 12 def self.secure_boundary(prefix = nil, length = 24) if prefix "#{prefix}-#{SecureRandom.urlsafe_base64(length, false)}" else SecureRandom.urlsafe_base64(length, false) end end |