C# Class SaneWeb.Resources.Utility

Exibir arquivo Open project: ext0/SaneWeb

Public Methods

Method Description
deserializeJSONToObject ( String json ) : Object

Deserializes an object from its JSON representation into a .NET object

fetchForClient ( Assembly assembly, String resourceName ) : byte[]

Gets data from an embedded resource in its binary representation

fetchFromResource ( Assembly assembly, String resourceName ) : String

Gets data from an embedded resource in its String representation

randomNumber ( ) : int

Generates a cryptographically secure random integer

randomNumber ( int minValue, int maxValue ) : int

Generates a random integer within a specified range

serializeObjectToJSON ( Object obj ) : String

Serializes an object to a JSON string

trustedRandomString ( int maxSize ) : string

Builds a cryptographically secure random String of the size maxSize

Method Details

deserializeJSONToObject() public static method

Deserializes an object from its JSON representation into a .NET object
public static deserializeJSONToObject ( String json ) : Object
json String JSON String to be deserialized
return Object

fetchForClient() public static method

Gets data from an embedded resource in its binary representation
public static fetchForClient ( Assembly assembly, String resourceName ) : byte[]
assembly System.Reflection.Assembly Assembly to search in
resourceName String Full name of the resource
return byte[]

fetchFromResource() public static method

Gets data from an embedded resource in its String representation
public static fetchFromResource ( Assembly assembly, String resourceName ) : String
assembly System.Reflection.Assembly Assembly to search in
resourceName String Full name of the resource
return String

randomNumber() public static method

Generates a cryptographically secure random integer
public static randomNumber ( ) : int
return int

randomNumber() public static method

Generates a random integer within a specified range
public static randomNumber ( int minValue, int maxValue ) : int
minValue int Inclusive minimum value of the requested integer
maxValue int Inclusive maximum value of the requested integer
return int

serializeObjectToJSON() public static method

Serializes an object to a JSON string
public static serializeObjectToJSON ( Object obj ) : String
obj Object Object to be serialized
return String

trustedRandomString() public static method

Builds a cryptographically secure random String of the size maxSize
public static trustedRandomString ( int maxSize ) : string
maxSize int Size of the generated String
return string