Last data update: 2014.03.03

R: Functions for BIGNUM representation of arbitrarily precise...
BIGNUMintR Documentation

Functions for BIGNUM representation of arbitrarily precise integers

Description

as.BIGNUMint encodes integer in BIGNUM format as raw vector as used by ASN.1 format.

Usage

as.BIGNUMint(what, scalar = TRUE)

Arguments

what

representation of an integer or a vector thereof. Currently supported formats include "bigz" objects from the "gmp" package, integers and reals.

scalar

if TRUE then the input is expected to be scalar and only the first element will be used (zero-length vectors raise an error). Otherwise the result will be a list of all converted elements.

Details

The BIGNUM representation as used in ASN.1 is a big-endian encoding of variable length stored in a raw vector. Negative numbers are stored in two-complement's encoding, but are currently unsupported by as.BIGNUMint.

Value

Raw vector in BIGNUM integer representation.

Note

Unless the input is of class "bigz" then 32-bit platforms only support integers up to 32-bit, 64-bit platforms up to 53-bit (when real vectors are used).

Author(s)

Simon Urbanek

Examples

as.BIGNUMint(65537)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(PKI)
Loading required package: base64enc
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/PKI/BIGNUMint.Rd_%03d_medium.png", width=480, height=480)
> ### Name: BIGNUMint
> ### Title: Functions for BIGNUM representation of arbitrarily precise
> ###   integers
> ### Aliases: BIGNUMint as.BIGNUMint
> ### Keywords: manip
> 
> ### ** Examples
> 
> as.BIGNUMint(65537)
[1] 01 00 01
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>