package # This is JSON::backportPP
JSON::backportPP5005;
use 5.005;
use strict;
my @properties;
$JSON::PP5005::VERSION = '1.10';
BEGIN {
sub utf8::is_utf8 {
0; # It is considered
JSON::PP::JSON_PP_encode_ascii = \&_encode_ascii;
*JSON::PP::JSON_PP_encode_latin1 = \&_encode_latin1;
*JSON::PP::JSON_PP_decode_surrogates = \&_decode_surrogates;
*JSON::PP::JSON
alid escaped unicode");
}
return pack('B*', $utf8bit);
}
sub JSON::PP::incr_text {
$_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new;
if ( $_[0]->{_incr_parser}->{incr_parsing} )
publicExponent');
*N = \&modulus;
*E = \&publicExponent;
}
use constant _JWK_THUMBPRINT_JSON_ORDER => qw( e kty n );
sub new {
my ($class, @args) = @_;
my $self = $class->SUPER::ne
package # This is JSON::backportPP
JSON::PP;
# JSON-2.0
use 5.005;
use strict;
use Exporter ();
BEGIN { @JSON::backportPP::ISA = ('Exporter') }
use overload ();
use JSON::backportPP::Boolean;
use Carp ();
#use Devel::Peek;
$JSON::backportPP::VERSION = '4.12';
@JSON::PP::EXPORT = qw(encode_json decode_json from_json to_json);
# instead of hash-access, i tried index-access for speed.
# b
GS => 19;
use constant OLD_PERL => $] < 5.008 ? 1 : 0;
use constant USE_B => $ENV{PERL_JSON_PP_USE_B} || 0;
use constant CORE_BOOL => defined &builtin::is_bool;
my $invalid_char_re;
BEGIN
package # This is JSON::backportPP
JSON::PP::Boolean;
use strict;
require overload;
local $^W;
overload::unimport('overload', qw(0+ ++ -- fallback));
overload::import('overload',
"0+" =>
${$_[0]} - 1 },
fallback => 1,
);
$JSON::backportPP::Boolean::VERSION = '4.12';
1;
__END__
=head1 NAME
JSON::PP::Boolean - dummy module providing JSON::PP::Boolean
=head1 SYNOPSIS
# do no
verload resolution for Storable and similar modules. See
L<JSON::PP> for more info about this class.
=head1 AUTHOR
This idea is from L<JSON::XS::Boolean> written by Marc Lehmann <schmorp[at]schmorp.
S string and file.
=head1 VERSION
Version 0.09
=cut
use strict; use warnings;
use 5.0006;
use JSON;
use File::Share ':all';
use Test::Builder;
require Exporter;
our @ISA = qw(Exporter);
our @E
r->new;
our $PROPERTIES = JSON->new->utf8(1)->decode(_read_file(dist_file('Test-CSS', 'properties.json')));
=head1 DESCRIPTION
The one and only feature of the package is to validate the CSS (stri
attrs ], $class;
}
sub get {
my ( $self, $attr ) = @_;
#Do we need to clone this? Could JSON suffice, or do we need Clone?
return $self->[1]{$attr};
}
sub to_string {
my ($self) = @
;
use IPC::SysV qw(
IPC_PRIVATE
IPC_CREAT
IPC_EXCL
IPC_NOWAIT
SEM_UNDO
);
use JSON qw(-convert_blessed_universally);
use Scalar::Util;
use String::CRC32;
use Storable 0.6 qw(freeze
storable') {
return _freeze($seg, $data);
}
elsif ($serializer eq 'json'){
return _encode_json($seg, $data);
}
return undef;
}
sub _end {
for my $s (values %proces
r eq 'json'){
return _decode_json($seg);
}
return undef;
}
sub _encode_json {
my $seg = shift;
my $data = shift;
my $json = encode_json $data;
if (length($json) > $
=> $self->error_message,
error_data => $self->error_data,
};
}
);
use JSON;
use Scalar::Util 'blessed';
use Time::HiRes 'time';
# A char between the HTTP-Method and the RE
wed_origins = split(" ", $allow_origin);
# we'll only handle requests that have either a JSON body or no body
my $http_request = $dsl->app->request;
my ($ct) = split(/;\s*/, $
tent_type // "", 2);
$ct //= "";
if ($http_request->body && ($ct ne 'application/json')) {
$dsl->pass();
}
my $http_method = uc($http_request->method);
ey = Crypt::Perl::RSA::Parse::public($buffer);
# Note that this accepts a structure, not raw JSON.
my $key = Crypt::Perl::RSA::Parse::jwk($jwk_hr);
=head1 DISCUSSION
See L<Crypt::Perl::RSA:
package # This is JSON::backportPP
JSON::backportPP56;
use 5.006;
use strict;
my @properties;
$JSON::PP56::VERSION = '1.08';
BEGIN {
sub utf8::is_utf8 {
my $len = length $_[0]; #
JSON::PP::JSON_PP_encode_ascii = \&_encode_ascii;
*JSON::PP::JSON_PP_encode_latin1 = \&_encode_latin1;
*JSON::PP::JSON_PP_decode_surrogates = \&JSON::PP::_decode_surrogates;
*JSON
::PP::JSON_PP_decode_unicode = \&JSON::PP::_decode_unicode;
unless ( defined &B::SVp_NOK ) { # missing in B module.
eval q{ sub B::SVp_NOK () { 0x02000000; } };
}
}
sub _encode
se Moo 1.006;
use PAUSE::Packages;
use PAUSE::Packages::Release;
use PAUSE::Packages::Module;
use JSON::MaybeXS;
use autodie 2.29;
has 'packages' =>
(
is => 'ro',
default =>
line)) {
chomp($line);
my ($path, $json) = split(/\s+/, $line, 2);
foreach my $entry (@{ decode_json($json) }) {
my $module = PAUSE::Packages::Modul
SIS
#You’ll probably instantiate this class using Parser.pm
#or Generate.pm.
#cf. JSON Web Algorithms (RFC 7518, page 5)
#These return an octet string.
$sig = $prkey->sign_RS25
s an object
my $pub_obj = $key->get_public_key();
# These return a hash reference, NOT a JSON string.
my $priv_hr = $key->get_struct_for_private_jwk();
my $pub_hr = $key->get_struct_
#!/usr/bin/env perl
use warnings;
use strict;
use Benchmark qw(:all) ;
use JSON qw(-convert_blessed_universally);
use Sereal qw(encode_sereal decode_sereal looks_like_sereal);
use Storable qw(freeze
tore => \&storable,
json => \&json,
},
);
cmpthese($ARGV[0],
{
sereal => \&serial,
store => \&storable,
json => \&json,
},
);
sub _data {
m
> {z => 26, y => 25},
);
return \%h;
}
sub json {
my $data = _data();
my $json = encode_json $data;
my $perl = decode_json $json;
}
sub serial {
my $data = _data();
my $en
parameters ANY DEFINED BY algorithm OPTIONAL
}
>;
use constant _JWK_THUMBPRINT_JSON_ORDER => qw( crv kty x );
sub to_der {
my ($self) = @_;
require Crypt::Perl::ASN1;
erl
use warnings;
use strict;
use Benchmark qw(:all) ;
use Data::Dumper;
use IPC::Shareable;
use JSON qw(-convert_blessed_universally);
use Storable qw(freeze thaw);
if (@ARGV < 1){
print "\n Ne
ash;
#timethese($ARGV[0],
# {
# json => \&json,
# store => \&storable,
# },
#);
cmpthese($ARGV[0],
{
json => \&json,
store => \&storable,
},
);
sub json {
my $base_data = default();
if (! %j_hash) {
tie %j_hash, 'IPC::Shareable', {
create => 1,
destroy => 1,
serializer => 'json'
r_public_jwk();
my $json = sprintf(
'{' . join(',', map { qq{"$_":"%s"} } $self->_JWK_THUMBPRINT_JSON_ORDER()) . '}',
@{$jwk}{ $self->_JWK_THUMBPRINT_JSON_ORDER() },
);
r
equire MIME::Base64;
return MIME::Base64::encode_base64url( $hash_cr->($json) );
}
1;
s an object
my $pub_obj = $key->get_public_key();
# This returns a hash reference, NOT a JSON string.
my $pub_hr = $key->get_struct_for_public_jwk();
=head1 DESCRIPTION
This class imple
y $pbkey = Crypt::Perl::Ed25519::Parse::public($buffer);
# This accepts a structure, not raw JSON.
my $key = Crypt::Perl::Ed25519::Parse::jwk($jwk_hr);
=head1 DESCRIPTION
See L<Crypt::Perl:
verify($msg_hash, $sig);
die 'Wut' if !$private->verify($msg_hash, $sig);
# Signature in JSON Web Algorithm format (deterministic):
my $jwa_sig = $private->sign_jwa($msg);
# You can